/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CastleDefense.Managers;

import CastleDefense.UnitList;

/**
 *
 * @author Firedemon
 */
public class UnitManager 
{
    /*
     * Variables
     */
    private UnitList UnitList = new UnitList();
    //units current upgrade level
    private int ArcheryLevel  = 0;
    private int MagicLevel    = 0;
    private int TrapLevel     = 0;
    private int HunterLevel   = 0;
    //units current upgrade cost
    private int ArcheryUpCost = 100;
    private int MagicUpCost   = 100;
    private int TrapUpCost    = 100;
    private int HunterUpCost  = 100;
    
    public void increaseArcheryLevel()
    {
        this.ArcheryLevel++;
    }

    public void increaseMagicLevel()
    {
        this.MagicLevel++;
    }

    public void increaseTrapLevel()
    {
        this.TrapLevel++;
    }

    public void increaseHunterLevel()
    {
        this.HunterLevel++;
    }
    
    public int getArcheryLevel()
    {
        return ArcheryLevel;
    }

    public int getMagicLevel()
    {
        return MagicLevel;
    }

    public int getTrapLevel()
    {
        return TrapLevel;
    }

    public int getHunterLevel()
    {
        return HunterLevel;
    }
    
    public void setArcheryUpCost(int cost)
    {
        this.ArcheryUpCost += cost;
    }

    public void setMagicUpCost(int cost)
    {
        this.MagicUpCost += cost;
    }

    public void setTrapUpCost(int cost)
    {
        this.TrapUpCost += cost;
    }

    public void setHunterUpCost(int cost)
    {
        this.HunterUpCost += cost;
    }
    
    public int getArcheryUpCost()
    {
        return ArcheryUpCost;
    }

    public int getMagicUpCost ()
    {
        return MagicUpCost;
    }

    public int getTrapUpCost ()
    {
        return TrapUpCost;
    }

    public int getHunterUpCost ()
    {
        return HunterUpCost;
    }
    
    public void reset()
    {
        ArcheryLevel  = 0;
        MagicLevel    = 0;
        TrapLevel     = 0;
        HunterLevel   = 0;
        
        ArcheryUpCost = 100;
        MagicUpCost   = 100;
        TrapUpCost    = 100;
        HunterUpCost  = 100;
    }
    
    //
    
    public void setUnitList(UnitList unitList)
    {
        this.UnitList = unitList;
    }
    
    public UnitList getUnitList()
    {
        return UnitList;
    }
    
    public static final UnitManager getInstance() 
    {
        return SingletonHolder.instance;
    }
    
    @SuppressWarnings("synthetic-access")
    public static class SingletonHolder
    {
        protected static final UnitManager instance = new UnitManager();
    }
}
